﻿<%@ Page Language="C#" AutoEventWireup="true" validateRequest="false"  CodeBehind="VipMemberManage.aspx.cs"
    Inherits="VipMemberManage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>欢迎使用工会管理系统</title>
    <link href="../style/main.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../JqueryUI/themes/ui-lightness/jquery-ui-1.7.2.custom.css" />

    <script type="text/javascript" src="../javascript/jquery-1.3.2-vsdoc2.js"></script>

    <script type="text/javascript" src="../javascript/jquery-ui-1.7.2.custom.js"></script>

    <script type="text/javascript" src="../javascript/Public.js"></script>

    <style type="text/css">
        table
        {
            font: 12px "宋体";
        }
        #tabCard th
        {
            width: 120px;
            background-color: #B2DBF7;
            height: 20px;
        }
        #tabCenter td
        {
            background-color: #B2DBF7;
            height: 20px;
        }
        #tabCard td
        {
            background-color: #FFFFFF;
            height: 24px;
        }
        .style1
        {
            color: #000000;
        }
    </style>

    <script type="text/javascript" language="javascript">

        $(document).ready(function() {
            //员工信息编辑
            $(".btnEdit").click(function() {
                window.showModalDialog("VipMemberCardAdd.aspx?Random=" + Math.random() + " &ID=" + ($.trim($(this).parent().find('td:eq(0)').text())), window, "dialogWidth:612px;dialogHeight:590px;status=no;help=no;scroll:no");
                var submitForm = document.getElementById("mainForm");
                submitForm.submit();
            });
            //员工家庭成员信息
            $(".btnFamily").click(function() {
                window.showModalDialog("VipFamilyList.aspx?Random=" + Math.random() + "&ID=" + ($.trim($(this).parent().find('td:eq(0)').text())) + "&Name=" + encodeURIComponent(($.trim($(this).parent().find('td:eq(1)').text()))), window, "dialogWidth:800px;dialogHeight:400px;status=no;help=no ");
            });

            $(".btnPrint").click(function() {
                openwindow('VipMemberCardPrint.aspx?Random=' + Math.random() + "&ID=" + ($.trim($(this).parent().find('td:eq(0)').text())), 'newwindow', 610, 500);
            });


            $(".btnDelete").click(function() {
                if (!confirm("确认删除员工信息吗？")) {
                    return;
                }
                var queryString = "";
                var FormFlg = "VipMember"; //处理画面区分，对应不同的后台业务处理
                var UpdateFlg = "Delete";   //操作区分，更新或者新规
                var Id = jQuery.trim(jQuery(this).parent().find('td:eq(0)').text());
                queryString = "FormFlg=" + FormFlg
                               + "&UpdateFlg=" + UpdateFlg
                               + "&Id=" + Id;
                $.ajax
                        ({
                            async: false,
                            type: "post", //ajax请求方式
                            url: "../ajaxUpdate.aspx", //请求服务器地址
                            datatype: "json", //希望数据库返回的数据类型
                            data: queryString, //发送给服务器的数据
                            processData: false, //阻止数据被自动转换为url编码
                            success: function(data) {//请求成功则调用该函数
                                if (data == "OK") {
                                    alert("删除成功！");
                                    var submitForm = document.getElementById("mainForm");
                                    submitForm.submit();
                                } else {

                                    alert("删除失败！");
                                }
                            }
                        });
            });


            $("#btnAdd").click(function() {
                window.showModalDialog("VipMemberCardAdd.aspx?Random=" + Math.random(), window, "dialogWidth:612px;dialogHeight:590px;status=no;help=no;scroll:no");
                var submitForm = document.getElementById("mainForm");
                submitForm.submit();
            });
        });
    </script>

</head>
<body>
    <form id="mainForm" runat="server">
    <object id="wb" name="wb" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0"
        width="0">
    </object>
    <table width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <table width="99%" cellpadding="0" cellspacing="0" class="table">
                    <tr>
                        <td valign="top">
                            <table width="100%" class="top" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td style="height: 22px;">
                                        &nbsp;<b>当前位置:</b>&nbsp;<a href="#">会员管理</a>&nbsp;>>&nbsp;<a href="#">会员管理</a>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 5px">
                        </td>
                    </tr>
                    <tr>
                        <td align="right" valign="middle" style="border: thin dotted #C0C0C0; background-color: #C5E5FC">
                            <table width="100%" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td>
                                        <img id="btnAdd" alt="" src="../Images/button/btnAddVipMember.gif" />&nbsp;&nbsp;
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 5px">
                        </td>
                    </tr>
                    <tr>
                        <td valign="top">
                            <table style="width: 100%; background-color: Silver" cellpadding="1px" cellspacing="1px">
                                <tr style="border: thin dotted #C0C0C0; background-color: #C5E5FC; height: 22px">
                                    <th>
                                        请选择单位
                                    </th>
                                    <th align="left">
                                        <%= this.displayTitle %>会员：<asp:Label ID="lblDataCount" runat="server" Text=""></asp:Label>
                                        人
                                    </th>
                                </tr>
                                <tr>
                                    <td style="width: 20%; background-color: #FFFFFF" valign="top">
                                        <asp:TreeView ID="trDepartMent" runat="server" ShowLines="True" Expanded="False"
                                            OnSelectedNodeChanged="trDepartMent_SelectedNodeChanged">
                                            <Nodes>
                                                <asp:TreeNode Text="乐山电业局" Value="0">
                                                    <asp:TreeNode Text="局机关" Value="局机关">
                                                        <asp:TreeNode Text="生产技术部" Value="生产技术部"></asp:TreeNode>
                                                        <asp:TreeNode Text="安全检查部" Value="1"></asp:TreeNode>
                                                    </asp:TreeNode>
                                                </asp:TreeNode>
                                            </Nodes>
                                            <RootNodeStyle ImageUrl="~/Images/closed_r.gif" />
                                            <ParentNodeStyle ImageUrl="~/Images/closed_r.gif" />
                                            <LeafNodeStyle ImageUrl="~/Images/closed_r.gif" />
                                        </asp:TreeView>
                                    </td>
                                    <td valign="top" style="background-color: #FFFFFF">
                                        <asp:DataList ID="dlVipMember" runat="server" RepeatColumns="4" RepeatDirection="Horizontal"
                                            Width="100%">
                                            <ItemTemplate>
                                                <table>
                                                    <tr>
                                                        <td style="display: none;">
                                                            <%# Eval("ID")%>
                                                        </td>
                                                        <td style="display: none;">
                                                            <%# Eval("姓名")%>
                                                        </td>
                                                        <td class="btnEdit" style="cursor: pointer;" align="left" colspan>
                                                            <img src="<%# Eval("PicPath")%>" height="36px" alt="<%# Eval("姓名")%>" width="36px"
                                                                border="0" />
                                                        </td>
                                                        <td class="btnFamily" style="cursor: pointer;" onmouseover="this.style.color='#FE2E2E'"
                                                            onmouseout="this.style.color='#075B92'">
                                                            家人信息
                                                        </td>
                                                        <td class="btnDelete" style="cursor: pointer;" onmouseover="this.style.color='#FE2E2E'"
                                                            onmouseout="this.style.color='#075B92'">
                                                            删除
                                                        </td>
                                                        <td class="btnPrint" style="cursor: pointer;" onmouseover="this.style.color='#FE2E2E'"
                                                            onmouseout="this.style.color='#075B92'">
                                                            打印
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td style="display: none">
                                                            <%# Eval("ID")%>
                                                        </td>
                                                        <td class="btnEdit" style="cursor: pointer; width: 100px; overflow: hidden; font-weight: bold;"
                                                            onmouseover="this.style.color='#FE2E2E'" onmouseout="this.style.color='#075B92'"
                                                            colspan="5">
                                                            <%# Eval("姓名")%>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </ItemTemplate>
                                        </asp:DataList>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="didDep" runat="server" />
    <asp:HiddenField ID="DidValue" runat="server" />
    </form>
</body>
</html>
